package com.hao.user.app.model.dto.user;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @author haoge
 * @version 1.0
 * @date 2023/5/21 17:24
 */
@Data
public class UserUpdateRequest implements Serializable {
    private static final long serialVersionUID = -5866269161113051005L;

    @NotNull
    @Min(value = 1,message = "参数错误")
    private Long id;

    /**
     * 用户昵称
     */
    private String username;

    @NotBlank (message = "账号不能为空")
    @Length (min = 4,message = "用户账号长度过短")
    @NotNull(message = "账号不能为空")
    private String userAccount;

    /**
     * 用户头像
     */
    private String userAvatar;

    @NotNull (message = "性别不能为空")
    private Integer gender;

    @NotBlank(message = "密码不能为空")
    @Length(min = 8,message = "密码过短")
    @NotNull(message = "密码不能为空")
    private String password;

    @NotBlank(message = "请再次输入密码")
    @Length(min = 8,message = "密码过短")
    @NotNull(message = "请再次输入密码")
    private String checkPassword;

    @NotBlank(message = "邮箱不能为空")
    @NotNull(message = "邮箱不能为空")
    @Email (message = "邮箱格式不对")
    private String email;

    @NotBlank(message = "手机号不能为空")
    @NotNull(message = "手机号不能为空")
    @Length(min = 11,max = 11,message = "请输入正确的手机号")
    @Pattern(regexp = "1[3|4|5|7|8][0-9]\\d{8}",message = "手机号格式不对")
    private String phone;

}
